<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<style>

</style>
<div id="app">
  <div>
    <!--如果条件判断，不想复用 使用key属性-->
    <span v-if="isFlag">
                <label for="username">用户账户</label>
                <input type="text" id="username" placeholder="请使用账号登录" key="username">
            </span>
    <span v-else>
                <label for="email">用户邮箱</label>
                <input type="text" id="email" placeholder="请使用邮箱登录" key="email">
            </span>
    <button @click="isFlag = !isFlag">切换</button>
  </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
  var vm = new Vue({
    el: '#app',
    data: {
      isFlag: true
    }
  })
</script>
</body>
</html>